package la.bbs558.util;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegUtils {
    public static List<String> extractMentions(String text) {
        List<String> mentions = new ArrayList<>();
        Pattern pattern = Pattern.compile("@([\\p{L}0-9_]+)");
        Matcher matcher = pattern.matcher(text);

        while (matcher.find()) {
            mentions.add(matcher.group(1));
        }

        return mentions;
    }
}
